#include "stdafx.h"
#include "Chip.h"

CChip::CChip(void)
{
}

CChip::~CChip(void)
{
}

void CChip::initialize(int index)
{
	m_nIndex = index;
	m_eArea = (AREA)( index / ASSET_CHIPS * ASSET_CHIPS );
	m_nRoomnum = index - m_eArea;
	m_eWhoseturn = noplayer;
	m_bIson = false;

	m_nLeft = takeLeftIndex(m_nIndex);
	m_nRight = takeRightIndex(m_nIndex);
	m_nUpordown = takeUporDownIndex(m_nIndex);
}

void CChip::setOn(PLAYER eWhoseturn)
{
	m_bIson = true;
	m_eWhoseturn = eWhoseturn;
}

PLAYER CChip::getWhoseturn(void)
{
	return m_eWhoseturn;
}

bool CChip::isOn(void)
{
	return m_bIson;
}

int CChip::getLeftIndex(void)
{
	return m_nLeft;
}

int CChip::getRightIndex(void)
{
	return m_nRight;
}

int CChip::getUpordownIndex(void)
{
	return m_nUpordown;
}